Skip to content

refactor: remove sequencer batch generation and BLS signing#939

Merged
FletcherMan merged 7 commits intomainfrom
remove-sequencer-batch-generation
May 6, 2026
Merged

refactor: remove sequencer batch generation and BLS signing#939
FletcherMan merged 7 commits intomainfrom
remove-sequencer-batch-generation

Conversation

@FletcherMan
Copy link
Copy Markdown
Collaborator

@FletcherMan FletcherMan commented Apr 23, 2026

Summary

Move L2 batch generation entirely off the consensus path so that the tx-submitter becomes the sole producer of L1 batches. The sequencer no longer seals/commits batches or carries BLS validator keys; consensus only proposes blocks.

Net change: 47 files, +232 / -1775 (heavy dead-code cleanup).

Changes

node/

  • Drop core/{batch_seal,batch_commit,batch_test}.go; trim core/batch.go down to GenesisBatchHeader (still needed by l2-genesis).
  • Strip Batcher impls, BLS verification, valsByTmKey, batchingCache, rollupABI, and BatchPointHeight / BatchIndex metrics from core/executor.go and core/sequencers.go.
  • Drop UpgradeBatchTime / BlsKeyCheckForkHeight from core/config.go and flags/flags.go.
  • Trim types/batch.go (remove l1TxNum / txsPayload, simplify Append), types/blob.go (drop sequencer-side blob sealing helpers), types/retryable_client.go (drop CommitBatch / AppendBlsSignature; remove batchHash *common.Hash from NewL2Block).
  • Remove BLS private-key load/pass from sequencer/tm_node.go and the matching nil arg in sequencer/mock/sequencer.go.
  • Clean dead helpers (HeightFromBlockBytes / WrappedBlockFromBytes / HeightFromBlockContextBytes) from types/consensus_message.go.
  • Delete cmd/keyconverter (depends on removed tendermint/blssignatures) and its registration in cmd/node/main.go.

ops/tools/

  • Delete ops/tools/bls12381 (dead BLS demo).
  • Drop the BLS key generation block from ops/tools/keygen/main.go; priv_validator_key / node_key / ETH account generation kept.

ops/docker/ + devnet

  • Delete ops/docker/node{0..3}/bls_key.json (no consumer left).
  • Drop the matching COPY directives from ops/docker/Dockerfile.l2-node-4.
  • Drop the bls_key.json copy step from ops/devnet-morph/devnet/setup_nodes.py.

deps

  • Bump go-ethereum submodule to morph-v2.2.2-alpha.2 (drops batchHash from authclient.NewL2Block; removes batch-write engine paths).
  • Bump tendermint module to v0.3.5-alpha.1 (drops blssignatures package and BLS args from NewNode).
  • make update propagates the new versions across all 8 Go modules.

Test plan

  • cd node && go vet ./...
  • cd node && go test ./... -short -count=1 ✅ (all packages PASS)
  • go vet ./... in tx-submitter / oracle / ops/tools / ops/l2-genesis / token-price-oracle / bindings / contracts
  • Full-repo grep -i bls_key → 0 hits
  • Full-repo grep -E 'UpgradeBatchTime|BlsKeyCheckForkHeight' → 0 hits in source
  • make devnet-up smoke test (recommend before merge)
  • CI green

Cross-repo coordination

Depends on (already merged / tagged):

  • morph-l2/go-ethereum @ morph-v2.2.2-alpha.2
  • morph-l2/tendermint @ v0.3.5-alpha.1

Made with Cursor

Summary by CodeRabbit

  • Chores

    • Upgraded Tendermint and go-ethereum across modules; refreshed Go module dependencies
    • Removed BLS key material from devnet and Docker node images
  • Refactor

    • Removed key-conversion CLI command and BLS key generation/verification tooling
    • Simplified runtime: batch creation/pack/seal/commit flows and blob/compression helpers removed
    • Removed BLS signature handling, related CLI flags/configuration, and batch-related metrics
  • Tests

    • Removed batch-, blob-, and BLS-related test suites
  • New

    • Added genesis batch-header builder for genesis tooling

Move L2 batch generation entirely off the consensus path so that the
tx-submitter becomes the sole producer of L1 batches. The sequencer no
longer seals/commits batches or carries BLS validator keys; consensus
only proposes blocks.

node:
- Drop core/{batch_seal,batch_commit,batch_test}.go and trim core/batch.go
  down to GenesisBatchHeader (still needed by l2-genesis).
- Strip Batcher impls, BLS verification, valsByTmKey, batchingCache,
  rollupABI, and BatchPointHeight/BatchIndex metrics from core/executor.go
  and core/sequencers.go.
- Drop UpgradeBatchTime / BlsKeyCheckForkHeight from config.go and flags.go.
- Trim types/batch.go (remove l1TxNum/txsPayload, simplify Append),
  types/blob.go (drop sequencer-side blob sealing helpers), and
  types/retryable_client.go (drop CommitBatch/AppendBlsSignature; remove
  batchHash *common.Hash from NewL2Block now that go-ethereum
  morph-v2.2.2-alpha.2 also drops it).
- Remove BLS private-key load/pass from sequencer/tm_node.go and the
  matching nil arg in sequencer/mock/sequencer.go.
- Clean dead helpers (HeightFromBlockBytes / WrappedBlockFromBytes /
  HeightFromBlockContextBytes) from types/consensus_message.go.
- Delete cmd/keyconverter (depends on removed tendermint/blssignatures)
  and its registration in cmd/node/main.go.

ops/tools:
- Delete ops/tools/bls12381 (dead BLS demo).
- Drop the BLS key generation block from ops/tools/keygen/main.go;
  priv_validator_key / node_key / ETH account generation kept.

ops/docker + devnet:
- Delete ops/docker/node{0..3}/bls_key.json (no consumer left).
- Drop the matching COPY directives from ops/docker/Dockerfile.l2-node-4.
- Drop the bls_key.json copy step from ops/devnet-morph/devnet/setup_nodes.py.

deps:
- Bump go-ethereum submodule to morph-v2.2.2-alpha.2.
- Bump tendermint module to v0.3.5-alpha.1.
- make update propagates the new versions across all 8 Go modules.

Verified with go vet ./... and go test ./... -short -count=1 in node;
go vet ./... in tx-submitter / oracle / ops/tools / ops/l2-genesis /
token-price-oracle / bindings / contracts.

Made-with: Cursor
@FletcherMan FletcherMan requested a review from a team as a code owner April 23, 2026 11:03
@FletcherMan FletcherMan requested review from Web3Jumb0 and removed request for a team April 23, 2026 11:03
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@FletcherMan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 15 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 772b4077-b481-4d8d-afe7-0cabdf71d75b

📥 Commits

Reviewing files that changed from the base of the PR and between 0701cda and 3142cab.

📒 Files selected for processing (4)
  • node/types/batch_header.go
  • ops/l2-genesis/morph-chain-ops/genesis/batch.go
  • tx-submitter/batch/batch_cache.go
  • tx-submitter/services/rollup.go
📝 Walkthrough

Walkthrough

Removes batch-building/BLS code and related metrics/tests; refactors executor/sequencer and retryable client APIs (NewL2Block); moves genesis batch-header builder into ops; deletes devnet BLS keys/tools; and bumps Morph go-ethereum and Tendermint versions across Makefile and many go.mod files.

Changes

Batching, BLS, Sequencer & Runtime Refactor

Layer / File(s) Summary
Data Shape / Types
node/types/batch_header.go, node/types/batch.go, node/types/blob.go, node/types/consensus_message.go
Removed concrete BatchHeaderV0/V1, BatchData, blob creation/compression/KZG helpers, DataHashV2, and block-height helper functions; rely on raw header bytes / BatchHeaderBytes.
Core Runtime Implementation
node/core/batch.go, node/core/batch_seal.go, node/core/batch_commit.go, node/types/batch_header.go
Deleted batch build/seal/commit implementations and associated helpers (batching cache, batching logic, sealing, batch hash computation, commit path).
Executor / Sequencer Logic
node/core/executor.go, node/core/sequencers.go, node/core/metrics.go, node/core/metrics.gen.go
Removed batch-hash propagation, BLS pubkey decoding/verification, batch-related fields/metrics; refactored validator tracking to TM-key set; changed DeliverBlock signature (removed returned BatchParams).
Retryable Client & Call Sites
node/types/retryable_client.go, node/sequencer/mock/sequencer.go
NewL2Block signature no longer accepts batchHash; removed CommitBatch and AppendBlsSignature retry wrappers; updated mock sequencer call.
CLI / Flags / Config
node/flags/flags.go, node/core/config.go, node/cmd/node/main.go, node/cmd/keyconverter/*
Removed GovAddress, UpgradeBatchTime, BlsKeyCheckForkHeight flags/fields; removed key-converter command and flags; simplified CLI population logic.
Metrics / Tests
node/core/metrics.gen.go, node/core/batch_test.go, node/types/batch_test.go, node/types/blob_test.go
Removed BatchPointHeight/BatchIndex metric initialization; deleted or invalidated batch/blob test suites.
Genesis builder move
ops/l2-genesis/morph-chain-ops/genesis/batch.go, ops/l2-genesis/cmd/genesis/cmd.go, ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go
Added local GenesisBatchHeader(genesisHeader *ethtypes.Header) ([]byte, error) builder and updated consumers to use raw header bytes.
Devnet / Ops / Docker / Tools
ops/devnet-morph/devnet/setup_nodes.py, ops/docker/Dockerfile.l2-node-4, ops/docker/node*/bls_key.json, ops/tools/keygen/main.go, ops/tools/bls12381/main.go
Stopped copying/including BLS key files for nodes 0–3; deleted persisted BLS key JSONs; removed BLS verification tool and BLS generation output from keygen.
Sequencer node init
node/sequencer/tm_node.go
Stopped creating/supplying Tendermint BLS private key during node setup.

Top-level dependency & module bumps

Layer / File(s) Summary
Makefile / Submodule
Makefile, go-ethereum
Bumped ETHEREUM_SUBMODULE_COMMIT_OR_TAG and ETHEREUM_TARGET_VERSION from morph-v2.2.1morph-v2.2.2; TENDERMINT_TARGET_VERSION from v0.3.6v0.3.7; advanced go-ethereum submodule pointer.
Module go.mod updates
bindings/go.mod, contracts/go.mod, node/go.mod, ops/l2-genesis/go.mod, ops/tools/go.mod, oracle/go.mod, token-price-oracle/go.mod, tx-submitter/go.mod, contracts/...
Replaced github.com/tendermint/tendermint with github.com/morph-l2/tendermint v0.3.7 where present; bumped github.com/morph-l2/go-ethereum pseudo-version across multiple go.mod files; moved some deps like holiman/uint256 to indirect where applicable.

Sequence Diagram(s)

sequenceDiagram
    participant TM as Tendermint
    participant Executor as Executor
    participant Sequencer as Sequencer (mock)
    participant L2Client as RetryableClient / AuthClient
    participant Eth as Ethereum Rollup

    TM->>Executor: DeliverBlock(txs, metaData, consensusData)
    Executor->>Sequencer: update validators / seqTmKeySet
    Sequencer->>Executor: provide l2Data
    Executor->>L2Client: NewL2Block(ctx, executableL2Data)
    L2Client->>Eth: submit NewL2Block tx
    Eth-->>L2Client: tx result
    L2Client-->>Executor: retry/err propagation
    Executor-->>TM: finalize block delivery
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • Web3Jumb0
  • panos-xyz
  • curryxbo

"🐰
I hopped through keys and batches wide,
I trimmed the BLS and let bytes glide,
I bumped the chains and pruned the rest,
Sequencers lean — they pass the test,
A carrot nod: the node's more spry!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'refactor: remove sequencer batch generation and BLS signing' directly and clearly summarizes the main change: removal of batch generation and BLS signing functionality from the sequencer, as confirmed by the comprehensive file deletions and simplifications throughout the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-sequencer-batch-generation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

fletcher.fan added 3 commits April 23, 2026 19:10
CI lint failed on flags/flags.go:328 with "File is not properly
formatted (gofmt)" — stray blank line left between the last flag
declaration and the closing paren of the var block when
UpgradeBatchTime / BlsKeyCheckForkHeight were removed in 82a9763.

Made-with: Cursor
tendermint v0.3.5-alpha.2 removes the nextBatchParams return value from
the L2Node.DeliverBlock interface (BatchParams is no longer consumed by
the centralized sequencer pipeline). Align morph/node and clean up the
follow-on dead code.

node/core/executor.go:
- DeliverBlock now returns only (nextValidatorSet, err); drop the
  *tmproto.BatchParams return value and the per-call batchParamsUpdates
  invocation.
- Rename getParamsAndValsAtHeight -> getValidatorsAtHeight; drop the
  BatchBlockInterval / BatchTimeout reads from Gov contract.
- Drop the unused batchParams field, the govCaller field/constructor,
  and the now-unused tmproto / time imports.

node/core/sequencers.go:
- Delete batchParamsUpdates and the now-unused tmproto / time / big
  imports.

node/core/config.go:
- Drop Config.GovAddress field, its default, and the GovAddr CLI parser
  branch — the address is no longer read by anything.

node/flags/flags.go:
- Drop the GovAddr CLI flag and its registration.

deps:
- Bump tendermint module to v0.3.5-alpha.2.
- make update propagates the new version across all 8 Go modules.

Verified with go vet ./..., gofmt -l ., make lint, and
go test ./... -short -count=1 in node; go vet ./... in tx-submitter /
oracle / ops/tools / ops/l2-genesis / token-price-oracle / bindings /
contracts.

Made-with: Cursor
Bring in the latest mainline updates while keeping this branch's current dependency pins during the in-flight refactor.

Made-with: Cursor
@curryxbo
Copy link
Copy Markdown
Contributor

Tendermint version mismatch (PR description vs Makefile)

The Cross-repo coordination section states:

morph-l2/tendermint @ v0.3.5-alpha.1

On branch remove-sequencer-batch-generation, Makefile sets:

TENDERMINT_TARGET_VERSION := v0.3.5-alpha.2

and the workspace go.mod replace directives point at v0.3.5-alpha.2, not v0.3.5-alpha.1.

Please update the PR description (and any release notes) so the documented tendermint tag matches what the repo actually pins—otherwise reviewers and release tooling may chase the wrong tag.

@curryxbo
Copy link
Copy Markdown
Contributor

Dead memoization field in BatchData (node/types/batch.go)

After the trim, BatchData.hash is never written anywhere — the cache branch in DataHash() is unreachable.

// node/types/batch.go
type BatchData struct {
    blockContexts []byte
    l1TxHashes    []byte
    blockNum      uint16

    hash *common.Hash   // never assigned
}

func (cks *BatchData) DataHash() common.Hash {
    if cks.hash != nil {     // always false
        return *cks.hash
    }
    // ... recompute every call ...
}

NewBatchData / Append / DataHash itself never touch cks.hash, and the previous setters (in the deleted batch_seal.go / batch_commit.go) are gone. So:

  • cks.hash is always nil
  • the if cks.hash != nil branch is dead
  • the field misleads future readers into thinking DataHash() is memoized when it isn't

Suggestion

Drop the field and the dead branch — there's only one live call site left (GenesisBatchHeader in node/core/batch.go, called once per genesis), so memoization buys nothing here, and keeping a non-functional cache contradicts the spirit of this PR (SPEC-004 §3.3 — no placeholder fields).

type BatchData struct {
    blockContexts []byte
    l1TxHashes    []byte
    blockNum      uint16
}

func (cks *BatchData) DataHash() common.Hash {
    var bz []byte
    for i := 0; i < int(cks.blockNum); i++ {
        bz = append(bz, cks.blockContexts[i*60:i*60+58]...)
    }
    bz = append(bz, cks.l1TxHashes...)
    return crypto.Keccak256Hash(bz)
}

(Alternative: if you'd rather keep the field, set cks.hash = &h before returning so the cache actually works — but option A above seems more in line with the rest of the cleanup.)

@panos-xyz
Copy link
Copy Markdown
Contributor

Code review (additional findings)

Found 2 more issues:

  1. [Important] Cross-repo dependency pins are inconsistent and not suitable as a final-merge state

The Makefile references tag names while go.mod uses pseudoversions pinned to the sibling PR heads, and the tags themselves don't match the pinned commits:

  • Makefile line 2-3 set ETHEREUM_TARGET_VERSION := morph-v2.2.2-alpha.2, but node/go.mod line 13 pins github.com/morph-l2/go-ethereum v1.10.14-0.20260423095304-4019516dd50c — the pseudoversion points at 4019516... (morph-l2/go-ethereum PR fix compile error #319 head), which is a different object than the morph-v2.2.2-alpha.2 tag label.
  • Makefile line 4 sets TENDERMINT_TARGET_VERSION := v0.3.5-alpha.2, and node/go.mod line 5 pins the same tag — but tag v0.3.5-alpha.2 = 72d5e469df30..., while morph-l2/tendermint PR Bump the npm_and_yarn group across 1 directories with 4 updates #35 head is f48e285c1bef... (2 commits ahead of alpha.2). tendermint main also already has a v0.3.6 tag (aa1b159f6dbe...), so pinning alpha.2 will silently miss any post-alpha.2 fixes.

This PR can't be the final merge state. Recommend: wait for morph-l2/go-ethereum #319 and morph-l2/tendermint #35 to merge, cut fresh tags from their final heads, then uniformly update Makefile, submodule, and every go.mod / go.sum in a follow-up commit before merging this PR.

morph/Makefile

Lines 1 to 6 in bb7552f

################## update dependencies ####################
ETHEREUM_SUBMODULE_COMMIT_OR_TAG := morph-v2.2.2-alpha.2
ETHEREUM_TARGET_VERSION := morph-v2.2.2-alpha.2
TENDERMINT_TARGET_VERSION := v0.3.5-alpha.2

morph/node/go.mod

Lines 3 to 14 in bb7552f

go 1.24.0
replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.5-alpha.2
require (
github.com/cenkalti/backoff/v4 v4.1.3
github.com/go-kit/kit v0.12.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru v1.0.2
github.com/klauspost/compress v1.17.9
github.com/morph-l2/go-ethereum v1.10.14-0.20260423095304-4019516dd50c
github.com/prometheus/client_golang v1.17.0

  1. [Medium] Deleted blob_test.go but the decode functions remain on the active derivation path

node/types/blob_test.go is deleted wholesale, but node/types/blob.go still exports RetrieveBlobBytes and DecodeTxsFromBytes, both of which are used by node/derivation/batch_info.go to parse tx-submitter's L1 batch blobs:

  • batch_info.go:110types.RetrieveBlobBytes(&batch.Sidecar.Blobs[0])
  • batch_info.go:137types.RetrieveBlobBytes(&blobCopy)
  • batch_info.go:171types.DecodeTxsFromBytes(txsData)

The PR correctly removed the sequencer-side encoders (MakeBlobCanonical, makeBlobCommitment, MakeBlobTxSidecar), but the L1-decode path is load-bearing for derivation correctness. Dropping all tests means future edits to decoding won't catch regressions. Recommend keeping a trimmed test file covering V0 / V1 / mixed MorphTx decode for RetrieveBlobBytes and DecodeTxsFromBytes.

}
if parentVersion == 0 {
blobData, err := types.RetrieveBlobBytes(&batch.Sidecar.Blobs[0])
if err != nil {
return err
}
batchBytes, err := zstd.DecompressBatchBytes(blobData)
if err != nil {
return fmt.Errorf("decompress batch bytes error:%v", err)
}
var startBlock BlockContext
if err := startBlock.Decode(batchBytes[:60]); err != nil {
return fmt.Errorf("decode chunk block context error:%v", err)
}
blockCount = batch.LastBlockNumber - startBlock.Number + 1
} else {
parentBatchBlock, err := parentBatchHeader.LastBlockNumber()
if err != nil {
return fmt.Errorf("decode batch header lastBlockNumber error:%v", err)
}
blockCount = batch.LastBlockNumber - parentBatchBlock
}
}
// If BlockContexts is not nil, the block context should not be included in the blob.
// Therefore, the required length must be zero.
length := blockCount * 60
for _, blob := range batch.Sidecar.Blobs {
blobCopy := blob
blobData, err := types.RetrieveBlobBytes(&blobCopy)
if err != nil {
return err
}
batchBytes, err := zstd.DecompressBatchBytes(blobData)
if err != nil {
return err
}
reader := bytes.NewReader(batchBytes)
if batch.BlockContexts == nil {
if len(batchBytes) < int(length) {
rawBlockContexts = append(rawBlockContexts, batchBytes...)
length -= uint64(len(batchBytes))
reader.Reset(nil)
} else {
bcBytes := make([]byte, length)
_, err = reader.Read(bcBytes)
if err != nil {
return fmt.Errorf("read block context error:%s", err.Error())
}
rawBlockContexts = append(rawBlockContexts, bcBytes...)
length = 0
}
}
data, err := io.ReadAll(reader)
if err != nil {
return fmt.Errorf("read txBytes error:%s", err.Error())
}
txsData = append(txsData, data...)
}
if batch.BlockContexts != nil {
blockCount = uint64(binary.BigEndian.Uint16(batch.BlockContexts[:2]))
rawBlockContexts = batch.BlockContexts[2 : 60*blockCount+2]
}
data, err := types.DecodeTxsFromBytes(txsData)
if err != nil {
return err

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Drop unused BatchHeaderV1 and the now-orphaned BatchHeaderV0 / BatchData
helpers from node/types.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go (1)

79-82: Strengthen this test with structural assertions, not only logging.

Line [81] logs output but does not verify header invariants; regressions in layout can slip through.

Suggested assertions
 	genesisBatchHeaderBytes, err := GenesisBatchHeader(l2GenesisBlock.Header())
 	require.NoError(t, err)
-	t.Logf("generated genesis batch header bytes: %x \n", genesisBatchHeaderBytes)
+	require.Len(t, genesisBatchHeaderBytes, 249)
+	require.Equal(t, byte(0), genesisBatchHeaderBytes[0]) // V0
+	require.Equal(t, l2GenesisBlock.Root().Bytes(), genesisBatchHeaderBytes[121:153]) // postStateRoot
+	t.Logf("generated genesis batch header bytes: %x \n", genesisBatchHeaderBytes)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go` around lines 79 -
82, The test currently only logs genesisBatchHeaderBytes; replace the log with
structural assertions: require.NotNil/require.NotEmpty on
genesisBatchHeaderBytes, require.Greater(len(genesisBatchHeaderBytes), 0) to
ensure it's populated, and assert determinism by calling
GenesisBatchHeader(l2GenesisBlock.Header()) a second time and require.Equal on
the two resulting byte slices; reference the GenesisBatchHeader function and
l2GenesisBlock.Header() to locate where to add these checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ops/l2-genesis/morph-chain-ops/genesis/batch.go`:
- Around line 24-40: GenesisBatchHeader currently dereferences header internals
and slices blockContext without guards; add checks at the start of
GenesisBatchHeader to ensure genesisHeader is non-nil, genesisHeader.Number (and
any other pointer big.Int fields you rely on, e.g., Number or BaseFee if
nullable in your types) is non-nil before calling Uint64() or using them, and
after calling wb.BlockContextBytes validate len(blockContext) >= 58 before
slicing; if any check fails, return a descriptive error instead of panicking.
Use the function name GenesisBatchHeader, the WrappedBlock construction and the
call to wb.BlockContextBytes to locate where to add these guards and error
returns.

---

Nitpick comments:
In `@ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go`:
- Around line 79-82: The test currently only logs genesisBatchHeaderBytes;
replace the log with structural assertions: require.NotNil/require.NotEmpty on
genesisBatchHeaderBytes, require.Greater(len(genesisBatchHeaderBytes), 0) to
ensure it's populated, and assert determinism by calling
GenesisBatchHeader(l2GenesisBlock.Header()) a second time and require.Equal on
the two resulting byte slices; reference the GenesisBatchHeader function and
l2GenesisBlock.Header() to locate where to add these checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5f987e7c-a955-42a8-b875-993bb127399a

📥 Commits

Reviewing files that changed from the base of the PR and between ea48163 and c81204a.

📒 Files selected for processing (6)
  • node/core/batch.go
  • node/types/batch.go
  • node/types/batch_header.go
  • ops/l2-genesis/cmd/genesis/cmd.go
  • ops/l2-genesis/morph-chain-ops/genesis/batch.go
  • ops/l2-genesis/morph-chain-ops/genesis/layer_two_test.go
💤 Files with no reviewable changes (3)
  • node/core/batch.go
  • node/types/batch_header.go
  • node/types/batch.go

Comment on lines +24 to +40
func GenesisBatchHeader(genesisHeader *ethtypes.Header) ([]byte, error) {
wb := nodetypes.WrappedBlock{
ParentHash: genesisHeader.ParentHash,
Miner: genesisHeader.Coinbase,
Number: genesisHeader.Number.Uint64(),
GasLimit: genesisHeader.GasLimit,
BaseFee: genesisHeader.BaseFee,
Timestamp: genesisHeader.Time,
StateRoot: genesisHeader.Root,
GasUsed: genesisHeader.GasUsed,
ReceiptRoot: genesisHeader.ReceiptHash,
}
blockContext := wb.BlockContextBytes(0, 0)
// Data hash for a single-block batch with no L1 messages:
// keccak256(blockContext[:58]). The last 2 bytes (numL1Messages) are excluded.
dataHash := crypto.Keccak256Hash(blockContext[:58])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add defensive guards to avoid panic paths in genesis header generation.

Line [24] and Line [39] currently assume non-nil header internals and fixed block-context length; malformed/unexpected input will panic instead of returning an error.

Proposed fix
 import (
 	"encoding/binary"
+	"fmt"
 
 	"github.com/morph-l2/go-ethereum/common"
 	ethtypes "github.com/morph-l2/go-ethereum/core/types"
 	"github.com/morph-l2/go-ethereum/crypto"
@@
 func GenesisBatchHeader(genesisHeader *ethtypes.Header) ([]byte, error) {
+	if genesisHeader == nil || genesisHeader.Number == nil || genesisHeader.BaseFee == nil {
+		return nil, fmt.Errorf("invalid genesis header: nil required field")
+	}
+
 	wb := nodetypes.WrappedBlock{
@@
 	}
 	blockContext := wb.BlockContextBytes(0, 0)
+	if len(blockContext) < 58 {
+		return nil, fmt.Errorf("unexpected block context length: %d", len(blockContext))
+	}
 	// Data hash for a single-block batch with no L1 messages:
 	// keccak256(blockContext[:58]). The last 2 bytes (numL1Messages) are excluded.
 	dataHash := crypto.Keccak256Hash(blockContext[:58])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ops/l2-genesis/morph-chain-ops/genesis/batch.go` around lines 24 - 40,
GenesisBatchHeader currently dereferences header internals and slices
blockContext without guards; add checks at the start of GenesisBatchHeader to
ensure genesisHeader is non-nil, genesisHeader.Number (and any other pointer
big.Int fields you rely on, e.g., Number or BaseFee if nullable in your types)
is non-nil before calling Uint64() or using them, and after calling
wb.BlockContextBytes validate len(blockContext) >= 58 before slicing; if any
check fails, return a descriptive error instead of panicking. Use the function
name GenesisBatchHeader, the WrappedBlock construction and the call to
wb.BlockContextBytes to locate where to add these guards and error returns.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@go-ethereum`:
- Line 1: Update the submodule pointer to the exact commit for the release tag
and align metadata: change the submodule reference currently pointing at commit
045be0fdc7ca6f80e18eb4e26f7452500292ccec to the tagged commit
6fe64bb1f7eb4a29671c2c7bb7764d66f0800df4 so the checked-out code matches
morph-v2.2.2, and update the go.mod pseudo-version (and any hardcoded commit
pin) to match that same tagged commit; also correct the PR description/version
strings (remove or replace morph-v2.2.2-alpha.2 and Tendermint v0.3.5-alpha.1)
so all references consistently point to morph-v2.2.2 and the proper Tendermint
release.

In `@Makefile`:
- Around line 2-4: The Makefile pins ETHEREUM_SUBMODULE_COMMIT_OR_TAG and
ETHEREUM_TARGET_VERSION to morph-v2.2.2 (commit 6fe64bb1f7e...), but go.mod pins
github.com/morph-l2/go-ethereum to pseudoversion
v1.10.14-0.20260506071313-045be0fdc7ca (commit 045be0fdc7ca), causing a
mismatch; fix by making them consistent: either update the go.mod pseudoversion
to the tagged commit (replace the v1.10.14-0...-045be0fdc7ca pseudoversion with
the revision that corresponds to
morph-v2.2.2/6fe64bb1f7eb4a29671c2c7bb7764d66f0800df4) or change
ETHEREUM_SUBMODULE_COMMIT_OR_TAG / ETHEREUM_TARGET_VERSION in the Makefile to
use the commit/pseudoversion actually referenced by go.mod (045be0fdc7ca), and
re-run go mod tidy/sum to ensure the module files and Makefile are aligned.

In `@node/go.mod`:
- Around line 5-13: The node/go.mod currently pins
github.com/morph-l2/go-ethereum to the pseudo-version
v1.10.14-0.20260506071313-045be0fdc7ca which conflicts with the Makefile's
ETHEREUM_TARGET_VERSION := morph-v2.2.2; confirm whether the tag morph-v2.2.2
references commit 045be0fdc7ca and if so replace the pseudo-version with the tag
in node/go.mod (and mirror the change across all workspace go.mod files),
otherwise update the Makefile ETHEREUM_TARGET_VERSION to the correct tag or
commit that matches the pseudo-version used in all go.mod files so that the
Makefile's update logic and all module pins are consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72ae408b-4b0a-488b-94f7-2efe2c61c81d

📥 Commits

Reviewing files that changed from the base of the PR and between c81204a and 0701cda.

⛔ Files ignored due to path filters (8)
  • bindings/go.sum is excluded by !**/*.sum
  • contracts/go.sum is excluded by !**/*.sum
  • node/go.sum is excluded by !**/*.sum
  • ops/l2-genesis/go.sum is excluded by !**/*.sum
  • ops/tools/go.sum is excluded by !**/*.sum
  • oracle/go.sum is excluded by !**/*.sum
  • token-price-oracle/go.sum is excluded by !**/*.sum
  • tx-submitter/go.sum is excluded by !**/*.sum
📒 Files selected for processing (10)
  • Makefile
  • bindings/go.mod
  • contracts/go.mod
  • go-ethereum
  • node/go.mod
  • ops/l2-genesis/go.mod
  • ops/tools/go.mod
  • oracle/go.mod
  • token-price-oracle/go.mod
  • tx-submitter/go.mod

Comment thread go-ethereum
@@ -1 +1 @@
Subproject commit 62952ec7d188953ee7b3224c3693baffa97c8084
Subproject commit 045be0fdc7ca6f80e18eb4e26f7452500292ccec
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm the tagged commit in morph-l2/go-ethereum matches the submodule pointer.
# Expected: the commit SHA for morph-v2.2.2 should start with 045be0fdc7ca.
gh api repos/morph-l2/go-ethereum/git/ref/tags/morph-v2.2.2 \
  --jq '.object | {type, sha}'

# Also check if the tag is annotated (object.type == "tag") and resolve to the commit:
gh api repos/morph-l2/go-ethereum/git/refs/tags \
  --jq '.[] | select(.ref | endswith("morph-v2.2.2")) | {ref, sha: .object.sha}'

Repository: morph-l2/morph

Length of output: 204


Submodule points to a commit that does not match the morph-v2.2.2 tag.

The tag morph-v2.2.2 in morph-l2/go-ethereum resolves to commit 6fe64bb1f7eb4a29671c2c7bb7764d66f0800df4, but the submodule here points to 045be0fdc7ca6f80e18eb4e26f7452500292ccec. While the go.mod pseudo-version is internally consistent with the submodule pointer, neither aligns with the final tagged release. This means the build will use an untagged intermediate commit rather than the official morph-v2.2.2 release — exactly the risk highlighted in prior review feedback.

Additionally, the PR description references outdated version numbers (morph-v2.2.2-alpha.2 and Tendermint v0.3.5-alpha.1) that no longer match the actual pins in the code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@go-ethereum` at line 1, Update the submodule pointer to the exact commit for
the release tag and align metadata: change the submodule reference currently
pointing at commit 045be0fdc7ca6f80e18eb4e26f7452500292ccec to the tagged commit
6fe64bb1f7eb4a29671c2c7bb7764d66f0800df4 so the checked-out code matches
morph-v2.2.2, and update the go.mod pseudo-version (and any hardcoded commit
pin) to match that same tagged commit; also correct the PR description/version
strings (remove or replace morph-v2.2.2-alpha.2 and Tendermint v0.3.5-alpha.1)
so all references consistently point to morph-v2.2.2 and the proper Tendermint
release.

Comment thread Makefile
Comment on lines +2 to +4
ETHEREUM_SUBMODULE_COMMIT_OR_TAG := morph-v2.2.2
ETHEREUM_TARGET_VERSION := morph-v2.2.2
TENDERMINT_TARGET_VERSION := v0.3.7
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Resolve the tag morph-v2.2.2 in morph-l2/go-ethereum and compare with the commit hash in go.mod pseudoversion.
# Expected: the short SHA embedded in the pseudoversion (045be0fdc7ca) should match the commit the tag points to.
gh api repos/morph-l2/go-ethereum/git/refs/tags/morph-v2.2.2 2>/dev/null | jq '{ref: .ref, sha: .object.sha}'
gh api repos/morph-l2/go-ethereum/git/refs/tags/morph-v2.2.2/peeled 2>/dev/null || true

# Similarly for tendermint v0.3.7
gh api repos/morph-l2/tendermint/git/refs/tags/v0.3.7 2>/dev/null | jq '{ref: .ref, sha: .object.sha}'

Repository: morph-l2/morph

Length of output: 366


The pseudoversion in go.mod files does not match the morph-v2.2.2 tag.

The tag morph-v2.2.2 in morph-l2/go-ethereum resolves to commit 6fe64bb1f7eb4a29671c2c7bb7764d66f0800df4, but the go.mod files pin github.com/morph-l2/go-ethereum at pseudoversion v1.10.14-0.20260506071313-045be0fdc7ca (commit 045be0fdc7ca). This mismatch means the builds are using a different commit than the Makefile authorizes. If 045be0fdc7ca is an intermediate or unmerged commit on a branch head, it could be rebased or overwritten later, breaking reproducibility.

Align the pseudoversion with the final tagged commit or update the Makefile to use the matching commit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 2 - 4, The Makefile pins
ETHEREUM_SUBMODULE_COMMIT_OR_TAG and ETHEREUM_TARGET_VERSION to morph-v2.2.2
(commit 6fe64bb1f7e...), but go.mod pins github.com/morph-l2/go-ethereum to
pseudoversion v1.10.14-0.20260506071313-045be0fdc7ca (commit 045be0fdc7ca),
causing a mismatch; fix by making them consistent: either update the go.mod
pseudoversion to the tagged commit (replace the v1.10.14-0...-045be0fdc7ca
pseudoversion with the revision that corresponds to
morph-v2.2.2/6fe64bb1f7eb4a29671c2c7bb7764d66f0800df4) or change
ETHEREUM_SUBMODULE_COMMIT_OR_TAG / ETHEREUM_TARGET_VERSION in the Makefile to
use the commit/pseudoversion actually referenced by go.mod (045be0fdc7ca), and
re-run go mod tidy/sum to ensure the module files and Makefile are aligned.

Comment thread node/go.mod
Comment on lines +5 to +13
replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7

require (
github.com/cenkalti/backoff/v4 v4.1.3
github.com/go-kit/kit v0.12.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru v1.0.2
github.com/holiman/uint256 v1.2.4
github.com/klauspost/compress v1.17.9
github.com/morph-l2/go-ethereum v1.10.14-0.20260317041928-1d4605778e32
github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

❓ Verification inconclusive

Script executed:

#!/bin/bash
set -euo pipefail

echo "== Versions in node/go.mod =="
rg -n 'morph-l2/(go-ethereum|tendermint)|replace github.com/tendermint/tendermint' node/go.mod

echo
echo "== Candidate Makefile pins =="
fd -i '^Makefile$' -HI | xargs -r rg -n 'ETHEREUM|TENDERMINT|morph-v|v0\.3\.'

echo
echo "== All go.mod pins for morph-l2 forks (workspace consistency) =="
fd -i 'go\.mod$' -HI | xargs -r rg -n 'github.com/morph-l2/(go-ethereum|tendermint)'

echo
echo "== Optional: go.work replacements/use blocks =="
fd -i '^go\.work$' -HI | xargs -r rg -n 'replace|use|morph-l2/(go-ethereum|tendermint)'

Repository: morph-l2/morph


Repository: morph-l2/morph
Exit code: 0

stdout:

== Versions in node/go.mod ==
5:replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7
13:	github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca

== Candidate Makefile pins ==
Makefile:2:ETHEREUM_SUBMODULE_COMMIT_OR_TAG := morph-v2.2.2
Makefile:3:ETHEREUM_TARGET_VERSION := morph-v2.2.2
Makefile:4:TENDERMINT_TARGET_VERSION := v0.3.7
Makefile:7:ETHEREUM_MODULE_NAME := github.com/morph-l2/go-ethereum
Makefile:8:TENDERMINT_MODULE_NAME := github.com/morph-l2/tendermint
Makefile:14:	`@if` grep -q '$(ETHEREUM_MODULE_NAME)' $(MODULE)/go.mod; then \
Makefile:15:		sed -i '' -e "s|$(ETHEREUM_MODULE_NAME) v[0-9][^[:space:]]*|$(ETHEREUM_MODULE_NAME) $(ETHEREUM_TARGET_VERSION)|" $(MODULE)/go.mod; \
Makefile:18:	`@if` grep -q '$(TENDERMINT_MODULE_NAME)' $(MODULE)/go.mod; then \
Makefile:19:		sed -i '' -e "s|$(TENDERMINT_MODULE_NAME) v[0-9][^[:space:]]*|$(TENDERMINT_MODULE_NAME) $(TENDERMINT_TARGET_VERSION)|" $(MODULE)/go.mod; \
Makefile:45:		echo "Updating go-ethereum submodule to tag $(ETHEREUM_SUBMODULE_COMMIT_OR_TAG)..."; \
Makefile:48:		git checkout $(ETHEREUM_SUBMODULE_COMMIT_OR_TAG) && \

== All go.mod pins for morph-l2 forks (workspace consistency) ==
tx-submitter/go.mod:5:replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7
tx-submitter/go.mod:12:	github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca
token-price-oracle/go.mod:11:	github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca
oracle/go.mod:5:replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7
oracle/go.mod:10:	github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca
ops/tools/go.mod:5:replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7
ops/tools/go.mod:8:	github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca
ops/l2-genesis/go.mod:5:replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7
ops/l2-genesis/go.mod:9:	github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca
node/go.mod:5:replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7
node/go.mod:13:	github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca
contracts/go.mod:5:replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7
contracts/go.mod:9:	github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca
bindings/go.mod:5:replace github.com/tendermint/tendermint => github.com/morph-l2/tendermint v0.3.7
bindings/go.mod:7:require github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca

== Optional: go.work replacements/use blocks ==
3:use (


Resolve Makefile/go.mod version drift for morph-l2/go-ethereum before merge.

The node/go.mod pins github.com/morph-l2/go-ethereum v1.10.14-0.20260506071313-045be0fdc7ca (pseudo-version, commit 045be0fdc7ca), but the Makefile declares ETHEREUM_TARGET_VERSION := morph-v2.2.2 (tag). This drift will break the Makefile's dependency update logic and cause non-reproducible builds. All other modules in the workspace share this same mismatch.

In contrast, morph-l2/tendermint is consistently pinned as v0.3.7 across all modules, which matches the Makefile's TENDERMINT_TARGET_VERSION.

Confirm that morph-v2.2.2 tag points to commit 045be0fdc7ca, or update both the Makefile and all go.mod files to use aligned version pins.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@node/go.mod` around lines 5 - 13, The node/go.mod currently pins
github.com/morph-l2/go-ethereum to the pseudo-version
v1.10.14-0.20260506071313-045be0fdc7ca which conflicts with the Makefile's
ETHEREUM_TARGET_VERSION := morph-v2.2.2; confirm whether the tag morph-v2.2.2
references commit 045be0fdc7ca and if so replace the pseudo-version with the tag
in node/go.mod (and mirror the change across all workspace go.mod files),
otherwise update the Makefile ETHEREUM_TARGET_VERSION to the correct tag or
commit that matches the pseudo-version used in all go.mod files so that the
Makefile's update logic and all module pins are consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>
@FletcherMan FletcherMan merged commit 4fb95dc into main May 6, 2026
15 checks passed
@FletcherMan FletcherMan deleted the remove-sequencer-batch-generation branch May 6, 2026 09:39
curryxbo pushed a commit that referenced this pull request May 6, 2026
Resolve conflicts after PR #939 (remove sequencer batch generation):
- node/types/batch_test.go: keep HEAD (multi_batch) version; it carries
  TestBatchHeaderV2 / TestBlobHashesHashUnavailableForLegacy which still
  exercise BatchHeaderV0/V1/V2 helpers retained on this branch.
- go.work.sum: union both sides (toolchain entries from x/exp, x/mod,
  x/tools); identical go directive on both branches.
- go-ethereum submodule: take main's 045be0fd (v2.2.2, includes the
  matching "Remove sequencer batch write paths" change for #939) over
  multi_batch's older 62952ec7.
- common/go.mod: bump tendermint replace from v0.3.4 -> v0.3.7 to align
  with node/tx-submitter/contracts/oracle/ops modules; common itself
  has no tendermint imports, the directive was stale and was the cause
  of "conflicting replacements for github.com/tendermint/tendermint" in
  the workspace build.

Co-authored-by: Cursor <cursoragent@cursor.com>
curryxbo pushed a commit that referenced this pull request May 7, 2026
Now that common/batch carries the V2 routing fix and the MorphTx V1 wire
decode fix (previous commit), redirect every consumer of the duplicated
node/types symbols to the common/batch versions. Three sites touched:

- node/derivation/batch_info.go: BatchHeaderBytes, MaxBlobBytesSize,
  RetrieveBlobBytes, DecodeTxsFromBytes — the parent header parse and
  blob byte extraction now go through the V2-aware helpers.
- node/derivation/batch_info_test.go: BatchHeaderV0/V1, EmptyVersionedHash,
  MaxBlobBytesSize, MakeBlobCanonical, RetrieveBlobBytes — the file
  references EmptyVersionedHash and MakeBlobCanonical which main's PR
  #939 deleted from node/types, so this also unbreaks
  `go test ./node/derivation/...`.
- oracle/oracle/batch.go: BatchHeaderBytes — its only nodetypes use; the
  nodetypes import is dropped here.

tx-submitter/utils/utils.go is intentionally NOT touched in this PR even
though it carries the same `node/types.BatchHeaderBytes` import: a naive
switch to common/batch closes a cycle (common/batch → tx-submitter/db →
tx-submitter/utils → common/batch). Untangling that cycle requires
moving BatchCache / batch_storage / batch_query out of common/batch and
down to tx-submitter/, which is a tx-submitter-owned refactor and out
of scope here. node/types/batch_header.go is therefore kept alive in
the next commit so that tx-submitter/utils continues to build; that
file carries a DEPRECATED header documenting the cleanup path.

types.WrappedBlock continues to come from node/types in batch_info.go —
it's a node-only consensus type, not part of the duplicated batch
encoding surface.

Co-authored-by: Cursor <cursoragent@cursor.com>
curryxbo pushed a commit that referenced this pull request May 7, 2026
…precated

- Delete node/types/blob.go: nothing under tx-submitter/* or anywhere
  else still imports MaxBlobBytesSize / RetrieveBlobBytes /
  DecodeTxsFromBytes / MakeBlobCanonical from node/types after the
  previous commit, so it can go.
- Delete node/types/batch_test.go: it referenced EmptyVersionedHash
  (which main's PR #939 already removed from node/types) and only
  exercised V0/V1 layout — the V2-aware unit tests now live in
  common/batch/batch_header_test.go.
- Keep node/types/batch_header.go but add a DEPRECATED file-header
  comment: tx-submitter/utils/utils.go still imports BatchHeaderBytes
  from here, and the obvious cleanup (turn this file into a thin
  re-export of common/batch.BatchHeaderBytes) would close an import
  cycle (common/batch → tx-submitter/db → tx-submitter/utils →
  common/batch via the shim). The header comment documents the proper
  cleanup path: move BatchCache out of common/batch into
  tx-submitter/, then redirect utils, then delete this file.

After this commit, the duplicate is intentional and documented. The
remaining cleanup is owned by the tx-submitter team.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants